/*
 * Copyright 2012 The LoadTestAnalyzer Project
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 */

package org.yantsu.loadtestanalyzer.ltaimporter.importers;

import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;

public interface Importer {
	public static class Data {
		public long timestamp = -1;
		public String hostname;
		public String category;
		public Map<String, Double> values = new HashMap<String, Double>();
		public Map<String, String> properties = new HashMap<String, String>();
	}
	
	/**
	 * Get the ES mapping for this agenttype
	 * This method is called 
	 * @return the mapping
	 */
	public String getMapping();
	
	/**
	 * Pass in testName and inputstream to be processed.
	 * @param testName
	 * @param in inputstream to be processed.
	 */
	public void initialize(String testName, InputStream in);
	
	/**
	 * Get the name of the test the data belonging to.
	 * @return the testname
	 */
	public String getTestname();

	/**
	 * Get data to be stored or <code>null</code> if no more data available
	 * 
	 * @return data to be stored or <code>null</code>;
	 */
	public Data next();
}
